Implementing extent granularity authorization command flow processing in CAPI adapters

ABSTRACT

A method, system and computer program product are provided for implementing block extent granularity authorization command flow processing for a Coherent Accelerator Processor Interface (CAPI) adapter. An Application Client builds a command including start LBA and number of LBAs and Child Authorization Handle. The Application Client sends the command directly to the CAPI Adapter via the Application Clients CAPI Server Registers assigned to the specific Application Client. The CAPI adapter validate that the requesting Client is authorized to perform the command using the Authorization Handle and the receiving CAPI Server Register address. The CAPI Adapter executes the validated command and sends completion back to the Application Client.

This application is a continuation application of Ser. No. 14/548,427filed Nov. 20, 2014.

FIELD OF THE INVENTION

The present invention relates generally to the data processing field,and more particularly, relates to a method, computer system and computerprogram product for implementing block extent granularity authorizationcommand flow processing in Coherent Accelerator Processor Interface(CAPI) adapters.

DESCRIPTION OF THE RELATED ART

Persistent secondary storage is a component of virtually all computersystems. This storage is usually a block device such as a hard diskdrive or flash storage device. Storage adapters often are used toconnect a host computer system to peripheral storage I/O devices such ashard disk drives, solid state drives, tape drives, compact disk drives,and the like.

In a traditional computer system an application that needs to read orwrite data to the block device makes an Operating System (OS) and/orFile System (FS) call to read or write the requested blocks of data. TheOperating System or File System is a Trusted part of the computer systemand as part of a Read/Write request will verify or authenticate that theapplication is allowed to access the requested blocks of data. If theauthentication is successful, the OS will build a command for theRead/Write request and send the command to the Host Bus Adapter (HBA) toservice. Since the HBA can only receive commands from the OS, the HBAknows that the requested range of Blocks has been authenticated and issafe to execute the command.

IBM has introduced a new Block Device I/O model as part of the OpenPOWERFoundation. This new Block Device I/O model uses Coherent AcceleratorProcessor Interface (CAPI) technology. CAPI allows an application tobuild a Read/Write command for an input/output adapter (IOA) and send itdirectly to the IOA, bypassing the OS/FS and as such also bypasses thetraditional authentication. Without authentication, an application canget to data that it should not be allowed to access. For example, in aserver system that contains proprietary data for a first competitor anda second competitor, the lack of authentication would allow the firstcompetitor to access second competitor's data.

Current techniques for block device authorization outside of an OS/FSuse out-of-band techniques such as zoning having a granularity level ofthe block device or Logical Unit (LUN).

A need exists for an effective mechanism to implement block extentgranularity authorization command flow processing for a CoherentAccelerator Processor Interface (CAPI) adapter in a computer system. Itis desirable that such mechanism enables effective and efficientutilization of the CAPI adapter, bypassing many host CPU requirementsfor performing IO operations.

SUMMARY OF THE INVENTION

Principal aspects of the present invention are to provide a method,system and computer program product for implementing block extentgranularity authorization command flow processing for a CoherentAccelerator Processor Interface (CAPI) adapter. Other important aspectsof the present invention are to provide such method, system and computerprogram product substantially without negative effects and that overcomemany of the disadvantages of prior art arrangements.

In brief, a method, system and computer program product are provided forimplementing block extent granularity authorization command flowprocessing for a Coherent Accelerator Processor Interface (CAPI)adapter. An Application Client builds a command including start LBA andnumber of LBAs and Child Authorization Handle. The Application Clientsends the command directly to the CAPI Adapter via the ApplicationClients CAPI Server Registers assigned to the specific ApplicationClient. The CAPI adapter validate that the requesting Client isauthorized to perform the command using the Authorization Handle and thereceiving CAPI Server Register address. The CAPI Adapter executes thevalidated command and sends completion back to the Application Client.

In accordance with features of the invention, the CAPI adapter enforcesaccess rights on each command by verifying that the Child AuthorizationHandle passed in the command belongs to the requesting Client and thatthe Client is authorized to the requested command, function, and Extent.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention together with the above and other objects andadvantages may best be understood from the following detaileddescription of the preferred embodiments of the invention illustrated inthe drawings, wherein:

FIGS. 1A and 1B, and FIG. 1C respectively illustrates an examplecomputer for implementing Coherent Accelerator Processor Interface(CAPI) authorization in a CAPI adapter and an example CAPI authorizationhandle array elements in accordance with the preferred embodiments;

FIGS. 2A and 2B illustrates example CAPI authorization operations tovalidate a command in accordance with the preferred embodiments;

FIGS. 3A, 3B, 3C, 3D, 3E and 3F illustrates example read command withCAPI authorization model and authentication process operations inaccordance with the preferred embodiments;

FIG. 4 illustrates example CAPI authorization model processingoperations in accordance with the preferred embodiments;

FIG. 5 illustrates example CAPI authorization initialization processingoperations in accordance with the preferred embodiments;

FIG. 6 illustrates example CAPI authorization processing operations inaccordance with the preferred embodiments;

FIG. 7 illustrates example CAPI authorization command flow processingoperations in accordance with the preferred embodiments;

FIG. 8 illustrates example CAPI authorization enforcement processingoperations in accordance with the preferred embodiments;

FIG. 9 illustrates example CAPI authorization mechanism and processingoperations in accordance with the preferred embodiments;

FIG. 10 illustrates example CAPI deauthorization processing operationsin accordance with the preferred embodiments;

FIGS. 11A and 11B illustrate example CAPI authorization read commandprocessing operations in accordance with the preferred embodiments; and

FIG. 12 is a block diagram illustrating a computer program product inaccordance with the preferred embodiment.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

In the following detailed description of embodiments of the invention,reference is made to the accompanying drawings, which illustrate exampleembodiments by which the invention may be practiced. It is to beunderstood that other embodiments may be utilized and structural changesmay be made without departing from the scope of the invention.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to be limiting of the invention. Asused herein, the singular forms “a”, “an” and “the” are intended toinclude the plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “comprises”and/or “comprising,” when used in this specification, specify thepresence of stated features, integers, steps, operations, elements,and/or components, but do not preclude the presence or addition of oneor more other features, integers, steps, operations, elements,components, and/or groups thereof.

In accordance with features of the invention, a method, system andcomputer program product are provided for implementing block extentgranularity authorization command flow processing in a CAPI adapter inaccordance with the preferred embodiments.

Having reference now to the drawings, in FIGS. 1A and 1B, there is shownan example computer system generally designated by the referencecharacter 100 for implementing block extent granularity authorizationcommand flow processing in a CAPI adapter 102 in accordance with thepreferred embodiments. Computer system 100 includes one or moreprocessors 104, or central processor units (CPUs) 104 (one shown)coupled to a system memory 106 and coupled by an I/O hub or CoherentAttach Processor Proxy (CAPP) 108 and Peripheral Component InterconnectExpress (PCI-Express or PCIE) connection to the CAPI adapter 102. TheCAPI adapter 102 includes an Authorization Table 112 containing multipleAuthorization Entries to implement authorization in accordance with thepreferred embodiments.

As shown in FIG. 1B, computer system 100 includes an example storagestack 120 including user CAPI client 122, an operating system 124including a file system 126, a hypervisor 128 coupled by CAPI/PCIEinterface block 130 to the CAPI adapter 102, which includes a filesystem authorization function 132 in accordance with the preferredembodiments. The CAPI/PCIE interface block 130 includes a CAPI transportmechanism that rides on top of a system transport mechanism or PCIE. TheCAPI client 122 is a unique system entity that has a separatelyidentified set of permissions to access CAPI adapter function.

Referring also to FIG. 1C, the authorization table 112 includesauthorization entries 140 to implement authorization in accordance withthe preferred embodiments. The illustrated example authorization entry140 includes a CAPI Client user ID 150, a CAPI server register space 152including resource and extents information and a CAPI set of allowedfunctions 154 including allowed access types in accordance with thepreferred embodiments.

In accordance with features of the invention, the CAPI server registerspace 152 is CAPI adapter system bus address space that containsmultiple copies of register(s) that can be used to start a command. Eachcopy is referred to as CAPI Server registers. Each CAPI Server registershave access to only the adapter Functions that the specific CAPI Serverregisters have previously been authorized to.

In accordance with features of the invention, a CAPI client ID is anindex to a specific copy of CAPI Server registers. One or more of theCAPI Clients is identified as Master Client(s). The CAPI Serverregisters for the Master Client are used to perform CAPI adapterinitialization functions and CAPI Server registers have access to allCAPI adapter functions.

Referring now to FIGS. 2A and 2B, there are shown example CAPIauthorization operations to validate a command in accordance with thepreferred embodiments. In FIG. 2A, example CAPI authorization operationsto validate a command are generally designated by the referencecharacter 200. Validation is done by the host, only authorized contextsmay write to the given MMIO space 202 shown in FIG. 2A and as indicatedin a block 222 in FIG. 2B. In FIG. 2A, an IO Adapter Request ControlBlock (IOARCB) 206 contains an authorization handle 208. As indicated atblock 222 in FIG. 2B and shown with authentication entry 140 in FIG. 2A,trusted handle data contains CAPI Server ID 214 and Resource and Range212. As indicated in a block 224, MMIO Space 202 is indexed by CAPIServer ID 214. As indicated in a block 226, Process Element 216 shown inFIG. 2A, is indexed by CAPI Server ID. As indicated in a block 228,Process Element 216 contains information needed to translate hostEffective Address to physical address.

Referring now to FIGS. 3A, 3B, 3C, 3D, 3E and 3F, there are shownexample read command operations including CAPI authorization model andauthentication process operations for a read command in accordance withthe preferred embodiments.

In FIG. 3A, example CAPI authorization operations for the read commandare generally designated by the reference character 300. Example CAPIauthorization operations 300 are shown with a user 302, OS 304,hypervisor 306, and CAPI adapter 102. Assume the OS is the “owning”context as indicated in a block 310 in FIG. 3B. As indicated in a block312, User does a syscall to “open” the file/hdisk. OS does an hcall toadd the user's context to the context list as indicated in a block 314.The hypervisor adds user's context to context list as indicated in ablock 316. The hypervisor does CAPI process to add the context into theadapter as indicated in a block 318.

In FIG. 3C, example CAPI authorization operations for the read commandare generally designated by the reference character 320. Example CAPIauthorization operations 320 are shown with user 302, OS 304, hypervisor306, and CAPI adapter 102. In FIG. 3D, as indicated in a block 322, thehypervisor returns the user's CAPI ID. The OS does a request to theadapter to “create authorization” and OS supplies User CAPI ID, andsupplies resource and extents to add the authorization as indicated in ablock 324. The adapter allocates an authorization handle for each extentand fills in the CAPI ID and extent information as indicated in a block326. As indicated in a block 328, the adapter returns the new userauthorization handle(s) to the operating system.

In FIG. 3E, example CAPI authorization operations for the read commandare generally designated by the reference character 330. Example CAPIauthorization operations 330 are shown with user 302, OS 304, hypervisor306, and CAPI adapter 102. In FIG. 3F, as indicated in a block 332 OSreturns authorization handle to the user. User sends a request to theadapter to issue the read as indicated in a block 334. Adapter uses theCAPI ID to identify which context to use as indicated in a block 336.Adapter uses the context to translate the host request address asindicated in a block 340.

As indicated in a block 342, adapter fetches the IO Adapter RequestControl Block (IOARCB). Adapter gets the authorization handle from theIOARCB as indicated in a block 344. Adapter verifies the authorizationhandle is the current version (all bits match) as indicated in a block346.

As indicated in a block 348 adapter verifies the authorization handle isfor the CAPI ID that was used. Adapter verifies that the range for therequest is allowed (data in the authorization handle data) as indicatedin a block 350. Adapter does the read as indicated in a block 352.Adapter translates the address and sends the data to the host (into theuser's memory) as indicated in a block 354. Adapter writes a queue,writes a memory location, generates an interrupt or whatever the desiredcompletion as indicated in a block 356.

In accordance with features of the invention, the CAPI authorizationmodel is based on split enforcement of rights, as illustrated anddescribed with respect to FIG. 4.

Referring now to FIG. 4, there are shown example CAPI authorizationmodel operations in accordance with the preferred embodiments startingat a block 400. As indicated in a block 402, the Trusted OS enforceswhich CAPI Server registers can be accessed by which Clients. This isaccomplished by, for example mapping a virtual address for a Client to aCAPI Server register space. As indicated in a block 404, the ParentClient (initially the Master Owning Client) notifies the CAPI adapter102 of which functions are allowed for a Child's CAPI Server. Asindicated in a block 406, the Parent Client sends a command orcommand(s) to its previously authorized CAPI Server register spaceidentifying the Functions, Commands, Extents, allowed to be sent to thenew Child's CAPI Server register space. As indicated in a block 408, theadapter generates and returns opaque Authorization Handle tokens asappropriate for each requested authorization element. The AuthorizationHandle is encoded in an implementation unique way to optimizeauthentication performance on the Read/Write commands. As indicated in ablock 410, the adapter enforces the functions allowed on each commandsent to a CAPI Server register space. At block 410, the Client sets theappropriate “Authorization Handle” in the Command; and the adapter usesthe “Authorization Handle” to validate the command is allowed to beexecuted by the receiving CAPI Server register space.

Referring now to FIG. 5, there are shown example CAPI authorizationinitialization process operations in accordance with the preferredembodiments starting at a block 500. As indicated in a block 502 adapterreset completes, and the Trusted OS Boot process transitions the adapterinto CAPI mode and identifies a Master Owning Client component and theadapter CAPI Server Register space assigned to the Master Owning Client.The Master Owning Client is default authorized to all Devices andfunctions under control of the adapter as indicated in a block 504. TheMaster Owning Client is identified as trusted as indicated in a block506. As indicated in a block 508, the Trusted OS creates an addressmapping for the Master Owning Client to access the CAPI Server Registerspace assigned to the Master Owning Client. This address mapping is notgiven to any other Client or Application.

The Master Owning Client can now send commands to the adapter asindicated in a block 510. As indicated in a block 512, other Clients orApplications do not have an address mapping to the Master OwningClient's Server register space and as such cannot send commands to theadapter via these registers.

Referring now to FIG. 6, there are shown example CAPI authorizationprocess operations in accordance with the preferred embodiments startingat a block 600. As indicated in a block 602, Application Client requestsauthorization to a file from the File system. The File system validatesthe request, determines the location of each Extent that comprises thefile, requests Authorization to each Extent from a System CAPIAuthorization manager as indicated in a block 604. The System CAPIAuthorization manager determines which CAPI Adapter is needed to serviceeach Extent, requests the CAPI Client manager to assign a (Child) ClientID and CAPI Server Register range to the requesting Application Client,and requests a previously authorized CAPI Parent Client (initially theMaster Client) to authorize the Child ID to the list of Extents asindicated in a block 606. As indicated in a block 608, The CAPI ParentClient sends a “Create Authorizations” command to the CAPI Adapter viathe Parent's CAPI Server Registers. Parameters are CAPI Child Client ID;List of Extents, for each Extent includes CAPI Parent AuthorizationHandle, and Extent Start LBA and number of Blocks; and List of otherCommands/Adapter resources, for each command/resource includes CAPIParent Authorization Handle. The CAPI Adapter validates that the ParentAuthorization Handle and CAPI Server Register range is valid for thespecific Extent/Command/Resource; creates an Authorization List byAssigning a new Child Authorization Handle for each requested, validatedExtent/Command/Resource; and returns the Authorization List to theParent Client as indicated in a block 610. The Parent Client returns theAuthorization List to Authorization Manager as indicated in a block 612.The Authorization Manager returns the Authorization List and the ChildClient ID to the File System and the File System returns theAuthorization List and the Child Client ID to the Application Client asindicated in a block 614.

Referring now to FIG. 7, there are shown example CAPI authorizationcommand flow process operations in accordance with the preferredembodiments starting at a block 700. As indicated in a block 702, theapplication client builds a command. parameters included are start LBAand number of LBAs; and child's authorization handle. As indicated in ablock 704, the application client sends the command directly to the CAPIadapter via the application clients's CAPI server registers. Asindicated in a block 706, the capi adapter uses the authorization handleand the receiving CAPI server register address to validate that therequesting client is authorized to perform the command. As indicated ina block 708, the CAPI adapter executes the command and sends completionback to the application client.

Referring now to FIG. 8, there are shown example CAPI authorizationenforcement process operations in accordance with the preferredembodiments starting at a block 800. As indicated in a block 802, accessto CAPI adapter server register spaces is enforced by the trusted OScreating address space mappings for individual clients/applications. Asindicated in a block 804, the adapter enforces access rights on eachcommand by verifying that the Authorization Handle passed in the commandbelong to the requesting Client and that the Client is authorized to therequested command/function/Extent.

Referring now to FIG. 9, there are shown example CAPI authorizationmechanism and process operations in accordance with the preferredembodiments starting at a block 900. As indicated in a block 902, encodethe Authorization Handle as multiple fields including Lookup TableIndex. The size of the Lookup Table Index field should be selected bythe implementation to maximize the number of potentially activeAuthorization Handles. The Authorization Handle includes ImplementationUnique Encode and the size of this field should be minimized but stillbe capable of detecting stale Credentials. As indicated in a block 904,create an Authorization Table containing multiple Authorization Entries.Each Authorization Entry contains Authorization Handle; CAPI Serverregisters ID; Start Logical Block Address of the Extent; and Range ofLogical Block Addresses for the Extent. As indicated in a block 906 theAuthentication Process when a command is received includes: Extract theLookup Table Index from the Authorization Handle contained in thereceived command. Use the Lookup table Index to locate the AuthorizationEntry. Compare the Authorization Entry's CAPI Server Registers ID to theReceiving CAPI Server Registers ID. Compare the Authorization Entry'sAuthorization handle to the Authorization Handle contained in thereceived command. Any Compare failures result in the command beingrejected.

Referring now to FIG. 10, there are shown example CAPI deauthorizationprocess operations in accordance with the preferred embodiments startingat a block 1000. As indicated in a block 1002, the Application ChildClient (or any Parent, GrandParent, and the like in the lineage) sends a“Delete Authorizations” command to the CAPI Adapter via the Client'sCAPI Server Registers. Parameters are: CAPI Child Client ID; List ofExtents. For each Extent include CAPI Child Authorization Handle; ExtentStart LBA and number of Blocks; and List of other Commands/Adapterresources. For each command/resource include CAPI Child AuthorizationHandle. As indicated in a block 1004, the CAPI Adapter validates thatthe Requester is either the Child or a Parent in the lineage; anddeletes the Authorizations in the Lists.

Referring now to FIGS. 11A and 11B, there are shown example CAPIauthorization read command processing operations in accordance with thepreferred embodiments. In FIG. 11A, example CAPI authorizationoperations for the read command are generally designated by thereference character 1100. Example CAPI authorization operations 1100 areshown with a user 1102, OS 1104, file system 1106, hypervisor 1108, andCAPI adapter 102. As indicated in a block 1102 in FIG. 11B, the OS goesto the filesystem and hypervisor to do the open. The hypervisor giveCAPI ID, filesystem does authorization checks and returns authorizationinformation and file handle (FH) as indicated in a block 1104. Asindicated in a block 1106, OS (at behest of filesystem) issues a createauthorization request. As indicated in a block 1108, Lseek only touchesuser filesystem. Read goes directly to CAPI Adapter as indicated in ablock 1110. As indicated in a block 1112, CAPI adapter validates CAPIID, authorization handle (AH), extents (filesystem authorization). Thenthe CAPI adapter does the operation (op), such as read request andresponds with the read data as indicated in a block 1114.

Referring now to FIG. 12, an article of manufacture or a computerprogram product 1200 of the invention is illustrated. The computerprogram product 1200 is tangibly embodied on a non-transitory computerreadable storage medium that includes a recording medium 1202, such as,a floppy disk, a high capacity read only memory in the form of anoptically read compact disk or CD-ROM, a tape, or another similarcomputer program product. Recording medium 1202 stores program means1204, 1206, 1208, and 1210 on the medium 1202 for carrying out themethods for implementing Coherent Accelerator Processor Interface (CAPI)authorization command flow processing in the CAPI adapter 102 of apreferred embodiment in the system 100 of FIGS. 1A, and 1B.

A sequence of program instructions or a logical assembly of one or moreinterrelated modules defined by the recorded program means 1204, 1206,1208, and 1210, direct the computer system 100 for implementing blockextent granularity authorization command flow processing in a CAPIadapter 102 of a preferred embodiment.

While the present invention has been described with reference to thedetails of the embodiments of the invention shown in the drawing, thesedetails are not intended to limit the scope of the invention as claimedin the appended claims.

What is claimed is:
 1. A method for implementing block extentgranularity authorization command flow processing for a CoherentAccelerator Processor Interface (CAPI) adapter in a computer systemcomprising: an Application Client, building a command including startLogical Block Address (LBA) and number of Logical Block Addresses (LBAs)and Child Authorization Handle, and sending the command directly to theCAPI Adapter via an Application Client CAPI Server Register assigned tothe Application Client; the CAPI Adapter validating the requestingApplication Client authorized to perform the command using the commandAuthorization Handle and the receiving CAPI Server Register address; andthe CAPI Adapter, responsive to validating the requesting ApplicationClient authorized to perform the command, executing the command andsending completion directly to the Application Client.
 2. The method asrecited in claim 1, wherein the CAPI Adapter enforces access rights oneach command by verifying that the Child Authorization Handle passed inthe command belongs to the requesting Application Client and that therequesting Application Client is authorized to the requested command,function, and Extent.
 3. The method as recited in claim 1, wherein theChild Authorization Handle defines client authorization for a subset ofa block device or Logical Unit (LUN).
 4. The method as recited in claim1, includes the CAPI Adapter generating and storing an authorizationtable with multiple authorization entries, each authorization entryincluding an Authorization Handle with CAPI server registersidentification (ID) including a start Logical Block Address of theextent and range of Logical Block Addresses for each extent.
 5. Themethod as recited in claim 4, wherein the CAPI Adapter validating therequesting Client authorized to perform the command using the commandAuthorization Handle and the receiving CAPI Server Register addressincludes the CAPI Adapter comparing an Authorization Handle from anidentified Authorization Entry in the authorization table and theAuthorization Handle contained in the received command.
 6. The method asrecited in claim 5, includes the CAPI adapter extracting a Lookup TableIndex from the Authorization Handle contained in the received commandand using the Lookup table Index to identify the Authorization Entry. 7.The method as recited in claim 6, includes comparing CAPI serverregisters identification (ID) from an identified Authorization Entry inthe authorization table and the receiving CAPI Server Register addressfor the received command.
 8. The method as recited in claim 7, includescomparing CAPI Server Registers start Logical Block Address of theextent and range of Logical Block Addresses in the Authorization Entryto the start LBA and number of LBAs contained in the received command.9. The method as recited in claim 8, includes responsive to a comparefailure rejecting the received command for preventing unauthorized dataaccess.
 10. The method as recited in claim 1, includes providing atransport mechanism comprising a Coherent Accelerator ProcessorInterface (CAPI) and Peripheral Component Interconnect Express (PCIE).